package com.zzty.txj.controller;


import com.zzty.txj.entity.WxConfigInfo;
import com.zzty.txj.util.Sha1Util;
import com.zzty.txj.util.WeiChatUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/map")
public class MapController {
    //private static String ticketUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
    @RequestMapping("/getConfig")
    public WxConfigInfo getWxConfig(HttpServletRequest request) throws Exception{

        WxConfigInfo wxConfigInfo =(WxConfigInfo)request.getSession().getAttribute("wxConfigInfoMap");

        return wxConfigInfo;
    }


    @RequestMapping("/getOpenId")
    public Map<String, String> getOpenId(HttpServletRequest request){
        String openId=(String)request.getSession().getAttribute("openId");

        Map<String,String> map=new HashMap<>();
        map.put("openId",openId);
        return map;
    }
}
